package com.jqk.mybatis.plus.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jqk.mybatis.plus.entity.User;
import com.jqk.mybatis.plus.mapper.UserMapper;
import com.jqk.mybatis.plus.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author:jiangqikun
 * @Date:2022/8/22 19:57
 **/
@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;


    @Override
    public void insertUsers(List<User> userList) {
        userMapper.insertBatchSomeColumn(userList);
    }

    @Override
    public void deleteById(String userId) {
        userMapper.deleteById(userId);
    }

    @Override
    public Page<User>getUusersPage(Integer pageIndex, Integer pageSize) {
        Page<User> page = new Page<>(pageIndex, pageSize);
        return userMapper.selectPage(page, null);
    }
}
